//package com.sskj.mqtt.many.mapper;
//
//import com.sskj.mqtt.many.MqttClientConnect;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.integration.annotation.ServiceActivator;
//import org.springframework.integration.core.MessageProducer;
//import org.springframework.integration.mqtt.inbound.MqttPahoMessageDrivenChannelAdapter;
//import org.springframework.integration.mqtt.support.MqttHeaders;
//import org.springframework.messaging.handler.annotation.Header;
//
//@Slf4j
//@Configuration
//public class MqttConfig {
//    @Bean
//    public MessageProducer inbound() {
//        MqttPahoMessageDrivenChannelAdapter adapter =
//            new MqttPahoMessageDrivenChannelAdapter("clientId", , "topic");
//        adapter.setOutputChannelName("mqttInputChannel");
//        return adapter;
//    }
//
//    @ServiceActivator(inputChannel = "mqttInputChannel")
//    public void handleMessage(String payload, @Header(MqttHeaders.RECEIVED_TOPIC) String topic) {
//        log.info("Received from {} : {}", topic, payload);
//    }
//}
